﻿using SQLite;
using System;
using System.Collections.Generic;
using System.Text;

namespace CnBlogsClient.Database.Models
{
    class ClientCredentials
    {
        [PrimaryKey, AutoIncrement]
        public int id
        {
            get; set;
        }

        public string AccessToken
        {
            get; set;
        }

        public int ExpiresIn
        {
            get; set;
        }

        public string TokenType
        {
            get; set;
        }

        public string Scope
        {
            get; set;
        }

        public DateTime GenerateTime
        {
            get; set;
        }

        public bool IsExpires
        {
            get
            {
                if (GenerateTime.AddSeconds(ExpiresIn) <= DateTime.Now)
                {
                    return true;
                }

                return false;
            }
        }
    }
}
